package maosy.poi.test

import com.jacob.activeX.ActiveXComponent
import com.jacob.com.Dispatch
import com.jacob.com.Variant
import org.apache.commons.codec.binary.Base64
import org.junit.Test
import java.io.BufferedReader
import java.io.File
import java.io.FileInputStream
import java.io.FileReader


class POIWordTest {

    fun read(){

    }


    @Test
    fun readWord() {
        val path = "/Users/mario/Downloads/E558王汝飞.doc"

        val file = File(path)
        println(file.exists())

        val fileInputStream = FileInputStream(File(path))
        val reader = BufferedReader(FileReader(file))
        reader.lines().forEach {
            println(it)
        }
//        val document = HWPFDocument(fileInputStream)
//        val ext = WordExtractor(document)
//        ext.paragraphText.forEach {
//            println(it)
//        }

//        val opcPackage = POIXMLDocument.openPackage(path)
//        val extractor = XWPFWordExtractor(opcPackage)
////        buffer = extractor.text
//        println(extractor.text)

    }


}